package org.hibernate.tutorial.hello.domain;

public class Message {
	
	private Long id;				// 唯一标示
	private String text;			// 消息内容
	private Message nextMessage;	// 下条消息的引用

	public Message() {}

	public Message(String text) {
		this.text = text;
	}

	public Long getId() {
		return id;
	}

	@SuppressWarnings("unused")		// 避免开发人员变更id数据，另外Hibernate可以通过反射调用方法
	private void setId(Long id) {
		this.id = id;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public Message getNextMessage() {
		return nextMessage;
	}

	public void setNextMessage(Message nextMessage) {
		this.nextMessage = nextMessage;
	}
}